package com.gy.paidao.setting;

import android.content.Intent;
import android.os.Bundle;
import android.widget.CheckBox;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.gy.paidao.BaseActivity;
import com.gy.paidao.R;
import com.gy.paidao.util.AnimUtil;

/**
 * 作者：gy on 16/2/24
 * 说明：设置界面
 */
public class SettingMainActivity extends BaseActivity {

    private LinearLayout ll_account_set, ll_privacy_security, ll_notify, ll_language,
            ll_internet, ll_refresh, ll_terms_service, ll_privacy_policy, ll_help_feedback, ll_about_us;
    private CheckBox cb_relax_mode, cb_low_data;
    private TextView tv_language;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentViewRes(R.layout.activity_setting_main_layout);
        setViews();
    }

    @Override
    protected void initVariable() {

    }

    @Override
    protected void setTitleViews() {
        titleText.setText(this.getResources().getString(R.string.set_setting));
    }

    @Override
    protected void setViews() {
        ll_account_set = (LinearLayout) findViewById(R.id.activity_set_ll_account_set);
        ll_privacy_security = (LinearLayout) findViewById(R.id.activity_set_ll_privacy_security);
        ll_notify = (LinearLayout) findViewById(R.id.activity_set_ll_notify);
        ll_language = (LinearLayout) findViewById(R.id.activity_set_ll_language);
        ll_internet = (LinearLayout) findViewById(R.id.activity_set_ll_internet);
        ll_refresh = (LinearLayout) findViewById(R.id.activity_set_ll_refresh);
        ll_terms_service = (LinearLayout) findViewById(R.id.activity_set_ll_terms_service);
        ll_privacy_policy = (LinearLayout) findViewById(R.id.activity_set_ll_privacy_policy);
        ll_help_feedback = (LinearLayout) findViewById(R.id.activity_set_ll_help_feedback);
        ll_about_us = (LinearLayout) findViewById(R.id.activity_set_ll_about_us);
        cb_relax_mode = (CheckBox) findViewById(R.id.activity_set_cb_relax_mode);
        cb_low_data = (CheckBox) findViewById(R.id.activity_set_cb_low_data);
        tv_language = (TextView) findViewById(R.id.activity_set_tv_language);

        ll_account_set.setOnClickListener(this);
        ll_privacy_security.setOnClickListener(this);
        ll_notify.setOnClickListener(this);
        ll_language.setOnClickListener(this);
        ll_internet.setOnClickListener(this);
        ll_refresh.setOnClickListener(this);
        ll_terms_service.setOnClickListener(this);
        ll_privacy_policy.setOnClickListener(this);
        ll_help_feedback.setOnClickListener(this);
        ll_about_us.setOnClickListener(this);
    }

    @Override
    protected void doClickAction(int viewId) {
        super.doClickAction(viewId);
        switch (viewId) {
            case R.id.title_ll_back:
                finish();
                AnimUtil.pushRightInAndOut(this);
                break;
            case R.id.activity_set_ll_account_set://账户设置
                intent = new Intent(this, AccountSetActivity.class);
                startActivity(intent);
                AnimUtil.pushLeftInAndOut(this);
                break;
            case R.id.activity_set_ll_privacy_security://隐私与安全
                intent = new Intent(this, PrivacySecurityActivity.class);
                startActivity(intent);
                AnimUtil.pushLeftInAndOut(this);
                break;
            case R.id.activity_set_ll_notify://通知
                intent = new Intent(this, NotificationsActivity.class);
                startActivity(intent);
                AnimUtil.pushLeftInAndOut(this);
                break;

        }
    }
}
